<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

function  Star(name,age) {
    this.name=name
    this.age=age


//     this.sayHi=function () {
//      console.log('ni hao  es5 ')
// }
  
}

//构造函数的prototype
Star.prototype.sayHi=function () {
     console.log('你好  es5 ')
}


let  ldh=new  Star('刘德华',19)
let  zxy= new Star('张学友',20)
let  gfc=  new  Star('郭富城',55)
 ldh.sayHi()
 zxy.sayHi()
 gfc.sayHi()


console.log(   ldh.sayHi==zxy.sayHi)
console.log(ldh.sayHi===zxy.sayHi)

console.log('------------')

console.log(ldh)

console.log(zxy)

console.log(gfc)


console.log('------------')

console.dir(Star)



    </script>
</body>
</html>